import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
import s from './EmptyPie.module.css';

export default function EmptyPie({ className, textContent, width = 32 }) {
	return (
		<div className={cn(className, s.container)}>
			<svg
				className={cn(s.emptyPie)}
				width="100%"
				height="100%"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				encoding="utf-8"
			>
				<circle
					cx="50%"
					cy="50%"
					r="40%"
					stroke="#CBD1DA"
					strokeWidth={width}
					fill="#fff"
				></circle>
			</svg>
			<div className={s.textContainer}>{textContent}</div>
		</div>
	);
}

EmptyPie.propTypes = {
	className: PropTypes.string,
	width: PropTypes.number,
	textContent: PropTypes.element,
};

EmptyPie.defaultProps = {
	className: s.emptyPie,
	textContent: <span>暂无数据</span>,
};
